<!DOCTYPE html>
<html>
<head>
    <title>原料耗材库</title>
    <#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap-table.min.css">
    <link href="${request.contextPath}/statics/plugins/select2/select2.min.css" rel="stylesheet"/>
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/oss/style.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/treegrid/index.css">
    <script src="${request.contextPath}/statics/libs/bootstrap-table.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.bootstrap3.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.extension.js"></script>
    <script src="${request.contextPath}/statics/plugins/layui/layui.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/tree.table.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/index.js"></script>

    <style>

        .form-horizontal {
            width: 1200px;
            position: relative;
        }
        .form-horizontal .form-group {
            width: 600px;
        }
        .el-col-15 {
            width: 42.5%;
            position: absolute;
            top: 19px;
            left: 600px;
        }
        .panel-default {

            height: 800px;
        }

    </style>

</head>
<body>
<div id="rrapp" v-cloak>
    <div class="row" v-show="showList">
        <div class="col-md-2 panel panel-default" >
            <div class="panel-heading">耗材分类</div>
            <ul id="categoryTree" class="ztree"></ul>
        </div>
        <div class="col-md-10 panel panel-default">
            <div class="panel-heading">耗材列表</div>
            <form class="form-inline" role="form">
                <a @click="reset"><i class="fa fa-refresh"></i></a>
                <div class="form-group">
                    <input type="text" class="form-control input-sm" v-model.trim="q.materialName" @keyup.enter="query" placeholder="耗材名称">
                </div>&nbsp;&nbsp;&nbsp;
                <div class="form-group">
                    <select class="form-control input-sm" v-model="q.status" @keyup.enter="query">
                        <option value="">发布状态</option>
                        <option v-for="item in e.materialStatusEnumList" :value="item.id">{{item.describe}}</option>
                    </select>
                </div>&nbsp;&nbsp;&nbsp;
                <a class="btn btn-default btn-sm"  @click="query">查询</a>&nbsp;&nbsp;&nbsp;
                <a class="btn btn-primary btn-sm" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>


                <a class="btn btn-primary btn-sm">
                    <input type="file" id="upfile" name="upfile" placeholder=""/>
                </a>

                <a class="btn btn-primary btn-sm" @click="importExp"><i class="fa fa-plus"></i>&nbsp;导入</a>

            </form>
            <table id="jqGrid"></table>
            <div id="jqGridPager"></div>
        </div>
    </div>
    <div v-show="!showList" class="panel panel-default" >
        <div class="padding-bottom">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group" style="display: none">
                <div class="col-sm-2 control-label">耗材编号:</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="material.materialCode" placeholder="耗材编号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"><span style="color: red;">*&nbsp;</span>耗材名称:</div>
                <div class="col-sm-10">
                    <input type="text" :readonly="mark.materialName" class="form-control" v-model="material.materialName" placeholder="耗材名称"/>
                </div><!--:readonly="isBlank(material.materialName)?'none':'readonly'"-->
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"><span style="color: red;">*&nbsp;</span>分类:</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" style="cursor:pointer;" v-model="material.categoryName" @click="materialCategoryTree" readonly="readonly" placeholder="一级分类"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"><span style="color: red;">*&nbsp;</span>计量单位:</div>
                <div class="col-sm-10">
                    <select class="form-control" :readonly="mark.unit" id="unitSelect" v-model="material.unit">
                        <option v-for="item in e.materialUnitList" :value="item.id">{{item.describe}}</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"><span style="color: red;">*&nbsp;</span>显示单位:</div>
                <div class="col-sm-10">
                    <input type="text" :readonly="mark.showUnit" class="form-control" v-model="material.showUnit" placeholder="请输入显示单位"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">型号:</div>
                <div class="col-sm-10">
                    <input type="text" :readonly="mark.materialModel" class="form-control" v-model="material.materialModel" placeholder="型号"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">规格:</div>
                <div class="col-sm-10">
                    <input type="text" :readonly="mark.specifications" class="form-control" v-model="material.specifications" placeholder="规格"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">长(单位米):</div>
                <div class="col-sm-10">
                    <input type="text" :readonly="mark.length" class="form-control" v-model="material.length" placeholder="长(单位米)"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">宽(单位米):</div>
                <div class="col-sm-10">
                    <input type="text" :readonly="mark.width" class="form-control" v-model="material.width" placeholder="宽(单位米)"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">克重(g):</div>
                <div class="col-sm-10">
                    <input type="text" :readonly="mark.weight" class="form-control" v-model="material.weight" placeholder="克重(g)"/>
                </div>
            </div>

            <el-col :span="15" class="el-col-15">
                <div>
                    <el-table
                            :data="storeStockMaterialDto.sellerInfoEntity"
                            stripe="true"
                            border="true"
                            size="small"
                            highlight-current-row="true"
                            style="width: 100%"
                            max-height="650"
                    >
                        <el-table-column  prop="sellerId" label="门店ID"></el-table-column>
                        <el-table-column  prop="sellerName" label="门店名称"></el-table-column>

                        <el-table-column label="单价(元)" width="120">
                            <template slot-scope="scope">
                                <el-input size="small" v-model="scope.row.cost" :disabled="scope.row.isHasValue && material.materialCode ? true:false"></el-input>
                            </template>
                        </el-table-column>
                    </el-table>
                </div>

            </el-col>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary btn-sm" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning btn-sm" @click="localRead" value="返回"/>
            </div>
        </form>
    </div>
</div>
<!-- 选择耗材分类 -->
<div id="materialCategoryLayer" style="display: none;padding:10px;">
    <ul id="materialCategoryTree" class="ztree"></ul>
</div>
<script src="${request.contextPath}/statics/js/modules/material/material.js?_${.now?long}"></script>

</body>
</html>